/*      视光检查      */
import request from '@/router/axios'

/*   ---主表---   */
//  获取验光号
export function getChkNumber(obj) {
  return request({
    url: '/admin/chkOptometryBasic/getChkNumber',
    method: 'get',
    params: obj
  })
}

//  新增视光主表
export function addChkOptometryBasic(obj) {
  return request({
    url: '/admin/chkOptometryBasic',
    method: 'post',
    data: obj
  })
}

//    分页查询视光检查主表
export function getChkOptometryList(obj) {
  return request({
    url: '/admin/chkOptometryBasic/page',
    method: 'get',
    params: obj
  })
}

//  根据ID删除视光主表
export function delChkOptometryBasic(id) {
  return request({
    url: '/admin/chkOptometryBasic/' + id,
    method: 'delete'
  })
}

//  根据主表ID查询信息
export function getChkOptometryBasic(id) {
  return request({
    url: '/admin/chkOptometryBasic/' + id,
    method: 'get'
  })
}


/*    ----戴镜史----    */
//  戴镜史保存
export function saveHistoryGlass(obj) {
  return request({
    url: '/admin/chkHisInfo',
    method: 'post',
    data: obj
  })
}

//  根据客户ID查询戴镜史
export function getHistoryGlass(customerId) {
  return request({
    url: '/admin/chkHisInfo/getByCustomerId/' + customerId,
    method: 'get'
  })
}


//  根据客户ID查询戴镜史
export function getHistoryGlassByPerson(personId) {
  return request({
    url: '/admin/chkHisInfo/getByPersonId/' + personId,
    method: 'get'
  })
}

/*    ----屈光检查----    */
//  屈光检查保存
export function addCheckRefractive(obj) {
  return request({
    url: '/admin/chkRefractive',
    method: 'post',
    data: obj
  })
}

//  根据主表ID查询屈光检查数据
export function getCheckRefractive(id) {
  return request({
    url: '/admin/chkRefractive/getByBasicId/'+id,
    method: 'get'
  })
}

//  根据ID查询屈光检查数据


/*    ----双眼视功能检查----    */
//  保存双眼视功能检查数据
export function saveDoubleEyeFunction(obj) {
  return request({
    url: '/admin/doubleEyeFunction',
    method: 'post',
    data: obj
  })
}

//  根据主表ID查询双眼视功能检查数据
export function getDoubleEye(id) {
  return request({
    url: '/admin/doubleEyeFunction/getByBasicId/'+id,
    method: 'get'
  })
}


/*    ----相关检查----    */
//  保存相关检查数据
export function saveHealthCheckData(obj) {
  return request({
    url: '/admin/healthCheck',
    method: 'post',
    data: obj
  })
}

//  根据主表ID查询相关检查数据
export function getHealthCheck(id) {
  return request({
    url: '/admin/healthCheck/getByBasicId/'+id,
    method: 'get'
  })
}

/*    ----接触镜评估----    */
//  保存接触镜评估数据
export function saveContactGlassData(obj) {
  return request({
    url: '/admin/contactGlass',
    method: 'post',
    data: obj
  })
}

//  根据主表ID查询接触镜评估数据
export function getContactGlass(id) {
  return request({
    url: '/admin/contactGlass/getByBasicId/'+id,
    method: 'get'
  })
}

/*    ----检查结论----    */
//	保存检查结论
export function saveCheckResultData(obj) {
  return request({
    url: '/admin/chkInspection',
    method: 'post',
    data: obj
  })
}

//  根据主表ID查询检查结论数据
export function getCheckResult(id) {
  return request({
    url: '/admin/chkInspection/getByBasicId/'+id,
    method: 'get'
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/dept/',
    method: 'get',
    params: obj
  })
}

export function getObj(id) {
  return request({
    url: '/admin/dept/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/admin/dept/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/dept/',
    method: 'put',
    data: obj
  })
}


export function getDeptInfo() {
  return request({
    url: '/admin/dept/getDeptList',
    method: 'get'
  })
}

export function preSave(obj) {
  return request({
    url: '/admin/chkOptometryBasic/preSave',
    method: 'post',
    data: obj
  })
}

export function getPreCheck(personId) {
  return request({
    url: '/admin/chkOptometryBasic/getPreCheck/'+personId,
    method: 'get'
  })
}

// export function getDeptInfoByDeptType(deptType) {
//   return request({
//     url: '/admin/dept/getDeptList/'+deptType,
//     method: 'get'
//   })
// }
